<html>
<head><meta charset="utf-8"><title>string continuation · t-lang/doc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/index.html">t-lang/doc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/string.20continuation.html">string continuation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="242113121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/string%20continuation/near/242113121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/string.20continuation.html#242113121">(Jun 09 2021 at 18:56)</a>:</h4>
<p>A question came up on <a href="https://github.com/rust-lang/reference/pull/1042">https://github.com/rust-lang/reference/pull/1042</a>.  The behavior of <code>\</code> at the end of a string line has surprising behavior in that it consumes <em>all</em> whitespace. This is different from other languages like Python where it will only consume a single line.  It is not clear if this was intended, since the reference was explicitly written to say it is only a single line, and the rustc tests only check for a single line.</p>
<p>It has been this way since it was introduced about 10 years ago: <a href="https://github.com/rust-lang/rust/commit/df9cf0be9b898bc3432d444826ff05d6d0e22f97">https://github.com/rust-lang/rust/commit/df9cf0be9b898bc3432d444826ff05d6d0e22f97</a></p>
<p>The question is, should the reference be changed to document how it actually works?  (I think the answer is yes.)  Is anyone else surprised by this?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>